package com.quaidi.smartlocker.controller;

import com.quaidi.smartlocker.common.Result;
import com.quaidi.smartlocker.entity.ExpressCompany;
import com.quaidi.smartlocker.service.ExpressCompanyService;
// import io.swagger.annotations.Api;
// import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 快递公司Controller
 * 
 * @author QuaiDi
 * @since 2025-08-26
 */
// @Api(tags = "快递公司管理")
@RestController
@RequestMapping("/api/express-companies")
public class ExpressCompanyController {

    @Autowired
    private ExpressCompanyService expressCompanyService;

    /**
     * 获取所有启用的快递公司
     */
    // @ApiOperation("获取所有启用的快递公司")
    @GetMapping("/active")
    public Result<List<ExpressCompany>> getAllActiveCompanies() {
        List<ExpressCompany> companies = expressCompanyService.getAllActiveCompanies();
        return Result.success(companies);
    }

    /**
     * 获取所有快递公司
     */
    // @ApiOperation("获取所有快递公司")
    @GetMapping("/all")
    public Result<List<ExpressCompany>> getAllCompanies() {
        List<ExpressCompany> companies = expressCompanyService.list();
        return Result.success(companies);
    }
}